home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl70b2.lha / tcl7.0b2 / doc / scan.n < prev    next >
Text File  |  1993-07-16  |  3KB  |  66 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/scan.n,v 1.2 93/07/16 16:55:51 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS scan tcl
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. scan \- Parse string using sscanf-style conversions
  29. .SH SYNOPSIS
  30. \fBscan \fIstring format varName \fR?\fIvarName ...\fR?
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. This command parses fields from an input string in the same fashion
  36. as the ANSI C \fBsscanf\fR procedure and returns a count of the number
  37. of fields sucessfully parsed.  \fIString\fR gives the input to
  38. be parsed and \fIformat\fR indicates how to parse it, using \fB%\fR
  39. fields as in \fBsscanf\fR.  Each \fIvarName\fR gives
  40. the name of a variable; when a field is scanned from \fIstring\fR,
  41. the result is converted back into a string and assigned to the
  42. corresponding \fIvarName\fR. 
  43. All of the \fBsscanf\fR conversion specifiers are valid except for
  44. the following differences:
  45. .IP [1]
  46. .VS
  47. \fB%p\fR and \fB%n\fR conversion specifiers are not currently
  48. supported.
  49. .VE
  50. .IP [2]
  51. For \fB%c\fR conversions a single character value is
  52. converted to a decimal string, which is then assigned to the
  53. corresponding \fIvarName\fR;
  54. no field width may be specified for this conversion.
  55. .IP [3]
  56. .VS
  57. The \fBl\fR, \fBh\fR, and \fBL\fR modifiers are ignored;  integer
  58. values are always converted as if there were no modifier present
  59. and real values are always converted as if the \fBl\fR modifier
  60. were present (i.e. type \fBdouble\fR is used for the internal
  61. representation).
  62. .VE
  63.  
  64. .SH KEYWORDS
  65. parse, scan
  66.